/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package task02bt02;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author tanhung
 */
public class Bai04 {
    public void run() throws IOException
    {
        
        FileInputStream fis = null;
        String sDuongDan;
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        
        try {
            String line;
            int soLuongPhanTu;
            
            System.out.println("Nhap duong dan tap tin du lieu:");
            sDuongDan = bf.readLine();
            fis = new FileInputStream(sDuongDan);
            BufferedReader fbf = new BufferedReader(new InputStreamReader(fis));
            
            line = fbf.readLine(); // doc dong dau tien
            soLuongPhanTu = Integer.parseInt(line);
            
            //Lay danh sach cac phan so
            System.out.println("Danh sach hoc sinh:");
            for(int i = 0; i < soLuongPhanTu; i++)
            {
                line = fbf.readLine();
                String[] sPart = line.split(" "); 
                System.out.println(String.format("%s %s %s %s", sPart[0],sPart[1],sPart[2],sPart[3] ));
                
            }
            
        } catch (IOException ex) {
            Logger.getLogger(Bai02.class.getName()).log(Level.SEVERE, null, ex);
        }finally{
            if(fis != null)
            {
                fis.close();
            }
        }
    }
}
